﻿#region Using namespaces

using System;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media.Imaging;

#endregion

namespace BOL.Apps.GeneNetworkBrowser.ViewModels
{
    public class MenuItemViewModel : CommandViewModel
    {
        #region Private variables

        protected Image _image;

        #endregion

        #region Public property

        public Image Image
        {
            get
            { 
                return _image;
            } 
            set
            {
                if (value != _image)
                {
                    _image = value;
                    OnPropertyChanged("Image");
                }
            }
        }

        #endregion

        #region Constructors

        public MenuItemViewModel(string name, Image image, ICommand command)
            : base(name, command)
        {
            _image = image;
        }

        public MenuItemViewModel(string name, string imagePath, ICommand command)
            : this(name, new Image { Source = new BitmapImage(new Uri(imagePath)) }, command) { }

        public MenuItemViewModel(string name, ICommand command)
            : this(name, new Image(), command) { }

        #endregion
    }
}
